<h1>Listing products</h1>

<table>
  <tr>
    <th>Name</th>
    <th>Desc</th>
    <th>Img url</th>
  </tr>

<% for product in @products %>
  <tr>
    <td><%=h product.name %></td>
    <td><%=h product.desc %></td>
    <td><%=h product.img_url %></td>
    <td><%= link_to 'Show', :action => 'show', :id => product %></td>
    <td><%= link_to 'Edit', :action => 'edit', :id => product %></td>
    <td><%= link_to 'Destroy',{:action => 'destroy', :id => product}, :confirm => 'Are you sure?', :method => :delete %></td>
  </tr>
<% end %>
</table>

<br />

<%= link_to('New product', :action => 'new') %>
